Skip to content

Share a2ui - #151

Open
jgindin wants to merge 10 commits into
mainfrom
share-a2ui
Open

Share a2ui#151
jgindin wants to merge 10 commits into
mainfrom
share-a2ui

Conversation

@jgindin

@jgindin jgindin commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Add a "share" button which generates a URL that can be shared. When opened, the A2UI JSON editor is populated with the same A2UI, and the preview renders it. The renderer used is also passed.

See https://screencast.googleplex.com/cast/NTI0Mzg5MjEyNjQ0OTY2NHw2YzA3ZjFiMy1jYQ. (Note that after clicking the "New Session", what you can't see is that I'm going to the URL bar and pasting the URL that the share button saved to the clipboard.)

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a feature to share designs in the A2UI Composer by compressing and encoding the active JSON payload into a URL-safe Base64 string using deflate-raw. It adds a 'Share design' button to copy the shareable URL, updates startup resolution to parse and load the shared payload, and includes comprehensive tests. The review feedback suggests hardening the utility methods in QueryParser with guard clauses for nullish or undefined inputs, adding corresponding unit tests, avoiding potential call stack overflow issues when converting large buffers, and refactoring direct globalThis references in ComposerShell to use Angular's injected DOCUMENT token.

Comment thread shell/src/app/shell/query-parser/query-parser.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.ts Outdated
Comment thread shell/src/app/shell/composer-shell/composer-shell.ts
Comment thread shell/src/app/shell/query-parser/query-parser.spec.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.spec.ts Outdated
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live (commit f4def73):
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

Comment thread shell/src/app/shell/composer-shell/composer-shell.spec.ts Outdated
Comment thread shell/src/app/shell/composer-shell/composer-shell.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.ts Outdated
Comment thread shell/src/app/shell/startup-resolution/startup-resolution.spec.ts
@jgindin
jgindin requested a review from suyangw-g August 6, 2026 13:58

@sugoi-yuzuru sugoi-yuzuru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it seems we are doing compress->base64 to URL-firendly stringifying the JSON.

While this is super nice feature, many messaging apps trucate URLs at 2000 chars, and many legacy browsers have a hard cap on how long a URL can be.

Are there any plans for safe-guarding the user from assuming all sharable links will be reliably translated in the same view?

E.g., if the image component happens to already contain a base64 encoded image data, it is very likely that this shared link will break.

@jgindin

jgindin commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

So, it seems we are doing compress->base64 to URL-firendly stringifying the JSON.

While this is super nice feature, many messaging apps trucate URLs at 2000 chars, and many legacy browsers have a hard cap on how long a URL can be.

Are there any plans for safe-guarding the user from assuming all sharable links will be reliably translated in the same view?

E.g., if the image component happens to already contain a base64 encoded image data, it is very likely that this shared link will break.

Thanks for catching this!

I've added checks for this situation, and will popup a notification to the user now if the incoming A2UI JSON is invalid.

@jgindin
jgindin requested a review from sugoi-yuzuru August 7, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants